/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.psi.action.supplychainmana;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.psi.mapper.supplychainmana.ContactsAddMapper;
public class ContactsAdd extends BaseAction
{
    @Autowired(required=false)
	private ContactsAddMapper mapper;
    /**
    增加联系人
    */
    
    public Map contactsAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> clienttype=mapper.clienttype(params);
        result.put("clienttype", clienttype);
        
        
        SQLList<SQLMap> clientsort=mapper.clientsort(params);
        result.put("clientsort", clientsort);
        
        
        SQLList<SQLMap> station_info=mapper.station_info(params);
        result.put("station_info", station_info);
        
        
        SQLList<SQLMap> phone=mapper.phone(params);
        result.put("phone", phone);
        
        
        SQLList<SQLMap> mails=mapper.mails(params);
        result.put("mails", mails);
        
        
        SQLList<SQLMap> ims=mapper.ims(params);
        result.put("ims", ims);
        
        
        SQLList<SQLMap> textmsgs=mapper.textmsgs(params);
        result.put("textmsgs", textmsgs);
        
        
        SQLList<SQLMap> phonetype=mapper.phonetype(params);
        result.put("phonetype", phonetype);
        
        
        SQLList<SQLMap> emailtype=mapper.emailtype(params);
        result.put("emailtype", emailtype);
        
        
        SQLList<SQLMap> text=mapper.text(params);
        result.put("text", text);
        
        
        SQLList<SQLMap> momentcon=mapper.momentcon(params);
        result.put("momentcon", momentcon);
        
        
        SQLList<SQLMap> momentconano=mapper.momentconano(params);
        result.put("momentconano", momentconano);
        
        return result;
    }
    /**
    增加联系人修改
    */
    
    public Map contactsAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int CMID1 = mapper.CMID1(params);
        result.put("CMID1", CMID1);
        
        
        for (SQLMap emt:hqlBean.getTableElements("phones")){
            params=new SQLParam(request,emt.getMap());
            mapper.pid(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("email")){
            params=new SQLParam(request,emt.getMap());
            mapper.eid(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("moment_contact")){
            params=new SQLParam(request,emt.getMap());
            mapper.mid(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("text_address")){
            params=new SQLParam(request,emt.getMap());
            mapper.tid(params);
        }
        
        
        int aid = mapper.aid(params);
        result.put("aid", aid);
        
        return result;
    }
}